package com.lh.service.impl;

import com.lh.dao.UserDao;
import com.lh.entity.User;
import com.lh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author: LuoHang
 * @Date: 2021/1/26 15:45
 * @Description
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public User login(Map<String,Object> map) {
        return userDao.login(map);
    }

    @Override
    public int register(Map<String, Object> map) {
        return userDao.register(map);
    }

    @Override
    public int update(Map<String, Object> map) {
        return userDao.update(map);
    }

    @Override
    public List<User> getUsers(Map<String,Object> map) {
        return userDao.getUsers(map);
    }

    @Override
    public int getCount(Map<String, Object> map) {
        return userDao.getCount(map);
    }

    @Override
    public User getUserById(Integer id) {
        return userDao.getUserById(id);
    }

    @Override
    public int deleteUserById(Integer id) {
        return userDao.deleteUserById(id);
    }

    @Override
    public int addUser(Map<String, Object> map) {
        return userDao.addUser(map);
    }

    @Override
    public int getRoleUserCount(Integer roleId) {
        return userDao.getRoleUserCount(roleId);
    }

    @Override
    public int getRegisterCountByDay(Date gmtCreate) {
        return userDao.getRegisterCountByDay(gmtCreate);
    }
}
